class VoiceService : Service() {
    private lateinit var speechRecognizer: SpeechRecognizer
    
    override fun onCreate() {
        super.onCreate()
        initSpeechRecognizer()
    }
    
    private fun initSpeechRecognizer() {
        speechRecognizer = SpeechRecognizer.createSpeechRecognizer(this)
        speechRecognizer.setRecognitionListener(object : RecognitionListener {
            override fun onResults(results: Bundle?) {
                val matches = results?.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION)
                matches?.get(0)?.let { command ->
                    when {
                        command.contains("同步") -> startSync()
                        command.contains("录音") -> startRecording()
                    }
                }
            }
            // ... 其他必要的 RecognitionListener 方法实现
        })
    }
    
    private fun startSync() {
        // 实现文件同步逻辑
    }
} 